package com.alili_tv.system.mapper;

import com.alili_tv.system.entity.Likes;
import com.alili_tv.system.entity.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 点赞表 Mapper 接口
 * </p>
 *
 * @author baomidou
 * @since 2023-03-17
 */
@Mapper
public interface LikesMapper extends BaseMapper<Likes> {

    /**
     * 是否有新点赞
     * @param userId
     * @return
     */
    boolean hasNew(@Param("userId") long userId);

    /**
     * 获取新的点赞信息，分组获取点赞数
     * @param userId
     * @return
     */
    List<Message> getNew(@Param("userId") long userId, int pageIndex, int pageSize);

}
